# coding=utf-8
# 全世界最帅的帅哥
from ysgg1_club_subject.comment.utils.decrypt_util import decrypt
from ysgg1_club_subject.settings.default import utils_path


class Config(object):
    # MySQL配置
    # 配置数据库和SQLALCHEMY
    HOSTNAME = '121.40.187.211'
    PORT = 3306
    DATABASE = 'ysgg1_club'
    USERNAME = 'root'
    ENCRYPTED_DATA = utils_path / 'encrypted_data.bin'
    DB_URI = "mysql+pymysql://{0}:{1}@{2}:{3}/{4}?charset=utf8mb4".format(USERNAME, decrypt(ENCRYPTED_DATA), HOSTNAME,
                                                                          PORT, DATABASE)
    SQLALCHEMY_ECHO = True
    SQLALCHEMY_DATABASE_URI = DB_URI
    # 不需要做数据追踪
    SQLALCHEMY_TRACK_MODIFICATIONS = False


    # CELERY 配置
    CELERY_RESULT_BACKEND = "redis://:ACceSsysgg1234@121.40.187.211:6379/3"
    CELERY_BROKER_URL = "amqp://admin:admin@121.40.187.211//"

